﻿var id = getvl("id");
$(function(){
	     if(id!=''){
	       $("#shujulaiyuan").attr("href","27.2.0shuju_dianpuqushi.html?id="+id);
	       $("#laiyuanfenxi").attr("href","27.1.0shuju_laiyuanfenxi.html?id="+id);
	       
	     }
});


 getOneAdmin2();
function getOneAdmin2() {
	$.ajax({
		url: urlcore + "/api/user/getadmin",
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success: function(data) {
			if(data.success == true) {
				if(data.data!=null && data.data!=""){
						shuju33(data.data.id);
				}
			}
		},
		error: function() {
			/* Act on the event */
			alert("error");
		}
	});
}


function shuju33(userid){
     		$("#maijia").html("");
     	$.ajax({   
             url: urlcore + "/api/visit/toStatistics2?userId="+userid,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					$("#maijia").html(data.data.payCount);
					$("#benyueshikuang").html("");
					var d = new Date();
                    var str = d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
					$("#benyueshikuang").html("截止： "+str);
						$("#yue").html("&yen;"+data.data.availableBalance);
						$("#fangkeshu").html(data.data.numberOfVisitors);
						
				}
			},
			error: function() {
				alert("error");
			}
		});
     }





     function shuju(){
     		$("#maijia").html("");
     	$.ajax({   
             url: urlcore + "/api/visit/selectPayBullInfoCount2?userId="+id,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					$("#maijia").html(data.data.count);
				}
			},
			error: function() {
				alert("error");
			}
		});
     }




     function fangkeshu(){
     		$("#fangkeshu").html("");
     	$.ajax({   
 url: urlcore + "/api/visit/selectVisitListCountshop?userId="+id,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					$("#fangkeshu").html(data.data.count);
				}
			},
			error: function() {
				alert("error");
			}
		});
     }
    
     function keryongyue(){
     		$("#yue").html("");
     	  $.ajax({   
          url: urlcore + "/api/userAccount/selectUserAccountDetails2?id="+id,
			type: "get", 
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
						
				
				}
			},
			error: function() {
				alert("error");
			}
		});
     
     }
